
<script type="text/html" data-help-name="IO中断">
    <p>IO中断节点：对指定引脚进行IO中断及处理</p>
  </script>
  
  

<script type="text/html" data-template-name="IO中断">

    <div class="form-row">
        <label for="node-input-name"><i class="fa fa-tag"></i> 名称</label>
        <input type="text" id="node-input-name" data-i18n="[placeholder]name">
    </div>

    <div class="form-row">
        <label for="node-input-pin"><i class="fa fa-circle"></i> Pin</label>
        <input type="text" id="node-input-pin">
      </div>
    
      <!--上下拉电阻设置 -->
      <div class="form-row">
          <label for="node-input-mode"><i class="fa fa-circle"></i> Mode</label>
          <select id="node-input-mode" style="width: 250px;">
            <option value="floating">浮空</option>
            <option value="pullUp">上拉</option>
            <option value="pullDown">下拉</option>
            </select>
      </div>
      
      <!-- 中断触发模式 -->
      <div class="form-row">
          <label for="node-input-interrupt"><i class="fa fa-circle"></i> Interrupt</label>
          <select id="node-input-interrupt" style="width: 250px;">
            <option value="rising">上升沿触发</option>
            <option value="falling">下降沿触发</option>
            <option value="both">双边沿触发</option>
      </div>

</script>

<script type="text/javascript">
    RED.nodes.registerType('IO中断',{
        category: 'Block 板载外设',
        color: '#35c1f4',
        defaults: {
            name: {value:""},
            pin:  {value:"", required: true, validate: RED.validators.regex(/^[0-9]*$/)},  //（在JS文件中进行引脚输入准确性的判断）
            mode: {value:"pullDown"},
            interrupt: {value:"both"},

            oldrc: {value:false}
        },
        inputs:0,
        outputs:1,

        icon: "bridge.svg",
        label: function() {
            return this.name||this._("IO中断");
        },
        outputLabels: function(i) {
          return this.name || this._("输出-触发信息");
        },

    });
</script>
